package top.atcra.rpc.service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ImplementRegistry {

    private static final Map<String, ServiceConfig> SERVICE_LIST = new ConcurrentHashMap<>(16);

    public static void register(ServiceConfig serviceConfig) {
        SERVICE_LIST.put(serviceConfig.getName() + serviceConfig.getGroup(), serviceConfig);
    }

    public static Object get(String serviceName) {
        return SERVICE_LIST.get(serviceName).getRef();
    }
}
